﻿using ActivateYourGlutes.Model.Internal;
using AutoMapper;

namespace ActivateYourGlutes.Model
{
    public static class ModelBootstrapper
    {
        public static void Initialise()
        {
            Mapper.CreateMap<Account, Contracts.Account>();
            Mapper.CreateMap<Activity, Contracts.Activity>();
            Mapper.CreateMap<Body, Contracts.Body>().
                ForMember(bp => bp.Measurements, opt => opt.MapFrom(b => b.MeasurementSet));
            Mapper.CreateMap<Goal, Contracts.Goal>();
            Mapper.CreateMap<Measurement, Contracts.Measurement>().
                ForMember(m => m.LocalisedValue, opt => opt.Ignore());
            Mapper.CreateMap<MeasurementType, Contracts.MeasurementType>();
            Mapper.CreateMap<UnitOfLength, Contracts.UnitOfLength>();
            Mapper.CreateMap<UnitOfWeight, Contracts.UnitOfWeight>();
            Mapper.CreateMap<Contracts.MeasurementType, MeasurementType>();
        }
    }
}